package com.xyoto.community.mapper.main;

import com.xyoto.community.entity.main.PrivateLetter;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 私信表操作mapper
 */
@Repository
public interface PrivateLetterMapper {
    /**
     * 新增私信记录
     * @param privateLetter
     * @return
     */
    Integer insertOne(PrivateLetter privateLetter);

    /**
     * 获取用户私信
     * @param userId
     * @param targetUserId
     * @return
     */
    List<PrivateLetter> getPrivateLetter(Integer userId, Integer targetUserId);

    /**
     * 获取用户私信未读数
     * @return
     * @param userId
     * @param targetUserId
     */
    Integer getReadCounts(Integer userId, Integer targetUserId);

    /**
     * 获取用户私信阅读状态
     * @param targetUserId
     * @param userId
     * @return
     */
    Short getReadStatus(Integer targetUserId,Integer userId);
}
